﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:src="clr-namespace:PMKS_Silverlight_App" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib"  x:Class="PMKS_Silverlight_App.JointInputTable" >
    <UserControl.Resources>
        <!--<src:JointsViewModel x:Name="JointsInfo" />-->
        <src:JointTypeProvider x:Name="jointTypeProvider"/>
    </UserControl.Resources>
        <s:DataGrid x:Name="dataGrid" AutoGenerateColumns="False" Background="Transparent" CanUserResizeColumns="True" 
               
                    CanUserReorderColumns="True" CanUserSortColumns="False" HeadersVisibility="All" RowEditEnded="dataGrid_RowEditEnded" CellEditEnded="dataGrid_CellEditEnded">
            <s:DataGrid.Columns>
                <s:DataGridTextColumn Header="Links" Binding="{Binding LinkNames}" Width="110"/>
                <s:DataGridTemplateColumn Header="Type of Joint">
                    <s:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding JointType}" />
                        </DataTemplate>
                    </s:DataGridTemplateColumn.CellTemplate>
                    <s:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox SelectedItem="{Binding JointType, Mode=TwoWay}" 
                                      ItemsSource="{Binding jointTypeList, Source={StaticResource jointTypeProvider}}" />
                        </DataTemplate>
                    </s:DataGridTemplateColumn.CellEditingTemplate>
                </s:DataGridTemplateColumn>
                <s:DataGridTextColumn Header="X Pos."  Binding="{Binding XPos}" />
                <s:DataGridTextColumn Header="Y Pos." Binding="{Binding YPos}"/>
                <s:DataGridTextColumn Header="Angle" Binding="{Binding Angle}"/>
                <s:DataGridCheckBoxColumn Header="Position Visible?" Binding="{Binding PosVisible}" Width="30"/>
                <s:DataGridCheckBoxColumn Header="Velocity?" Binding="{Binding VelocityVisible}" Width="30"/>
                <s:DataGridCheckBoxColumn Header="Acceleration?" Binding="{Binding AccelerationVisible}" Width="30"/>
            </s:DataGrid.Columns>
        </s:DataGrid>
</UserControl>
